﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace FerrSimplicity
{
    public class FontStyle
    {
        public string     styleName;
        public SpriteFont font;
        public Color      tint;
    }
    public class ManagerFontStyle
    {
        #region Singleton
        private static ManagerFontStyle mInstance;
        public  static ManagerFontStyle Instance { get { if (mInstance == null) mInstance = new ManagerFontStyle(); return mInstance; } }
        private ManagerFontStyle()
        {
            mStyles = new List<FontStyle>();
        }
        #endregion

        #region Fields
        List<FontStyle> mStyles = new List<FontStyle>();
        #endregion

        #region Methods
        public void      AddStyle   (string aStyleName, SpriteFont aFont, Color aColor)
        {
            FontStyle fs = new FontStyle();

            fs.styleName = aStyleName;
            fs.font      = aFont;
            fs.tint      = aColor;

            mStyles.Add(fs);
        }
        public FontStyle GetStyle   (string aStyleName)
        {
            for (int i = 0; i < mStyles.Count; i++)
            {
                if (mStyles[i].styleName == aStyleName)
                    return mStyles[i];
            }
            return null;
        }
        public FontStyle GetDefault ()
        {
            if (mStyles.Count >= 0)
                return mStyles[0];

            return null;
        }
        public void      ClearStyles()
        {
            mStyles.Clear();
        }
        #endregion
    }
}

